
import javax.microedition.lcdui.ChoiceGroup;
//import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Gauge;
import javax.microedition.lcdui.Item;
import javax.microedition.lcdui.List;
import javax.microedition.lcdui.StringItem;
import javax.microedition.lcdui.TextField;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author VO CHI DUNG
 */
public class Configuration {
    public Configuration(PlanTable p)
    {
        parent = p;
        frm = new Form("Cau Hinh");

        ChoiceGroup choiceGroup1 = new ChoiceGroup("Level Importance", ChoiceGroup.EXCLUSIVE);
        ChoiceGroup choiceGroup2 = new ChoiceGroup("Color", List.EXCLUSIVE);

        Item item = new StringItem("Music: ", "Browse", Item.BUTTON);

        choiceGroup1.append("rat quan trong", null);
        choiceGroup1.append("Quan Trong", null);
        choiceGroup1.append("Binh thuong", null);
        choiceGroup1.append("Khong can thiet", null);

        choiceGroup2.append("Red", null);
        choiceGroup2.append("Blue", null);
        choiceGroup2.append("Yellow", null);

        item.setDefaultCommand(GlobalVariableStatic.CMD_PRESS);

        frm.append(choiceGroup1);
        frm.append(new TextField("Cong Viec", "", 15, TextField.ANY));
        frm.append(item);
        frm.append(new Gauge("Interactive", true, 10, 0));
        frm.append(choiceGroup2);

        frm.addCommand(GlobalVariableStatic.CMD_BACK);
        frm.addCommand(GlobalVariableStatic.CMD_OK);

        frm.setCommandListener(parent);
    }

    public Form GetForm()
    {
        return frm;
    }

    public void HandleInput(Command c)
    {
         if(GlobalVariableStatic.CMD_BACK == c)
         {
            parent.Switch(GlobalVariableStatic.MENU);
         }
         else if(GlobalVariableStatic.CMD_OK == c)
         {
//            parent.dataTask.insert(new RecordTask(work.getString(), date.getDate().getTime(),choiceGroup.getSelectedIndex(),"", ""));
//            parent.updateListWork();
//            parent.Switch(GlobalVariableStatic.LISTWORK);
         }
    }

    private Form frm;
    private PlanTable parent;
}
